package cn.kgc.springcloud.controller;

import cn.kgc.springcloud.client.HystrixClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author mosin
 * date 2022/1/6
 * @version 1.0
 */
@RestController
public class OpenHystrixController {
    @Autowired
    private HystrixClient hystrixClient;
    @GetMapping("/oh1")
    public String test01(){
        return "OpenHystrix service invoke ok";
    }

    @GetMapping("/oh2")
    public String test02(){
        String s = hystrixClient.test01();
        return "OpenHystrix service invoke ok :: "+s;
    }

    @GetMapping("/oh3")
    public String test03(Integer id){
        String s = hystrixClient.test02(id);
        return "OpenHystrix service invoke ok ::" +s;
    }

}
